import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import {logger} from "redux-logger/src";
import thunk from "redux-thunk";
import {composeWithDevTools} from "redux-devtools-extension";
import {createStore, applyMiddleware} from "redux";
import reducer from './redux/reducers/index'

import {Provider} from "react-redux";
import {BrowserRouter} from "react-router-dom";
import memoryUtils from "./utils/memoryUtils";
import storageUtils from "./utils/storageUtils";

const user = storageUtils.getUser()
memoryUtils.user = user

const store = createStore(reducer, composeWithDevTools(applyMiddleware(logger, thunk)))

ReactDOM.render(
    <BrowserRouter>
        <Provider store={store}>
            <App/>
        </Provider>
    </BrowserRouter>
    ,
    document.getElementById('root')
);

